﻿package fab.geom
{
	import flash.geom.Point;
	import fab.geom.Line;
	import flash.geom.Rectangle;

	public class Cone extends Circle
	{
		private var angle_start:Number;
		private var angle_end:Number;
		public var line1:Line;
		public var line2:Line;
		
		public function Cone( c:Point, r:Number, a1:Number, a2:Number )
		{
			super( c, r );
			angle_start = a1;
			angle_end = a2;
			
			line1 = new Line( centre, angle_start, "polaire" );
			line2 = new Line( centre, angle_end, "polaire" );			
		}
		override public function containsPoint( p:Point ):Boolean
		{
			if ( !super.containsPoint( p ) ) return false;
			return line1.where( p ) < 0 && line2.where( p ) > 0;
		}
	}
}